﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
    <meta name="msapplication-tap-highlight" content="no" />
    <title id='Description'>JavaScript ToolBar - Mobile Example</title>
    <link rel="stylesheet" href="../styles/demo.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.windowsphone.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.blackberry.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.android.css" type="text/css" />
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.mobile.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../simulator.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxtoolbar.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var theme = prepareSimulator("input");

            $("#jqxToolBar").jqxToolBar({
                theme: theme,
                width: '80%', height: 55, tools: 'toggleButton toggleButton toggleButton | toggleButton',
                initTools: function (type, index, tool, menuToolIninitialization) {
                    if (type == "toggleButton") {
                        var icon = $("<div class='jqx-editor-toolbar-icon jqx-editor-toolbar-icon-" + theme + " buttonIcon'></div>");
                    }
                    switch (index) {
                        case 0:
                            icon.addClass("jqx-editor-toolbar-icon-bold jqx-editor-toolbar-icon-bold-" + theme);
                            icon.attr("title", "Bold");
                            tool.append(icon);
                            break;
                        case 1:
                            icon.addClass("jqx-editor-toolbar-icon-italic jqx-editor-toolbar-icon-italic-" + theme);
                            icon.attr("title", "Italic");
                            tool.append(icon);
                            break;
                        case 2:
                            icon.addClass("jqx-editor-toolbar-icon-underline jqx-editor-toolbar-icon-underline-" + theme);
                            icon.attr("title", "Underline");
                            tool.append(icon);
                            break;
                        case 3:
                            tool.jqxToggleButton({ width: 80, toggled: true });
                            tool.text("Enabled");
                            tool.on("click", function () {
                                var toggled = tool.jqxToggleButton("toggled");
                                if (toggled) {
                                    tool.text("Enabled");
                                } else {
                                    tool.text("Disabled");
                                }
                            });
                            break;
                    }
                }
            });

            initSimulator("input");
        });
    </script>
</head>
<body class='default'>
    <div id="demoContainer" class="device-mobile">
        <div id="container" class="device-mobile-container">
            <div style="margin-left:10%; margin-top:100px;" id="jqxToolBar">
            </div>
        </div>
    </div>
</body>
</html>
